package top.luckyluxcis.api;

import lombok.experimental.UtilityClass;
import top.luckyluxcis.RollApi;
import top.luckyluxcis.type.GirlImage;
import top.luckyluxcis.util.MapUtil;

import java.util.List;
import java.util.Map;

/**
 * @author Zhuang
 * @since 2023/9/25
 */
@SuppressWarnings("unused")
@UtilityClass
public class GirlsUtil {
    private static final RollApi API = RollApi.getInstance();

    /**
     * 随机获取福利图片
     *
     * @return {@link List}<{@link GirlImage}>
     */
    public static List<GirlImage> random() {
        return API.get("/image/girl/list/random", MapUtil.empty(), List.class, GirlImage.class);
    }

    /**
     * 获取福利图片列表。
     *
     * @param page 当前页数，从1开始
     * @return {@link List}<{@link GirlImage}>
     */
    public static List<GirlImage> list(int page) {
        Map<String, Object> params = MapUtil.<String, Object>builder()
                .put("page", page)
                .build();
        return API.get("/image/girl/list/random", params, List.class, GirlImage.class);
    }
}
